tier1_large_median_ggplot <- ggplot(pred_tier1_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tier1_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tier1_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tier1_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tier1_large_median_ggplot
tier1_large_mean_ggplot <- ggplot(pred_tier1_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tier1_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tier1_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tier1_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tier1_large_mean_ggplot
tier2_large_median_ggplot <- ggplot(pred_tier2_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tier2_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tier2_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tier2_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tier2_large_median_ggplot
tier2_large_mean_ggplot <- ggplot(pred_tier2_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tier2_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tier2_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tier2_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tier2_large_mean_ggplot
tier3.4_large_median_ggplot <- ggplot(pred_tier3.4_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tier3.4_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tier3.4_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tier3.4_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tier3.4_large_median_ggplot
tier3.4_large_mean_ggplot <- ggplot(pred_tier3.4_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tier3.4_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tier3.4_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tier3.4_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tier3.4_large_mean_ggplot
### tier1_small_median
ggplot(pred_tier1_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tier1_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tier1_small_mean ###
geom_xribbon(data = pred_tier1_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tier1_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tier1_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tier1_small_1q ###
geom_xribbon(data = pred_tier1_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tier1_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tier1_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tier1_small_min ###
geom_xribbon(data = pred_tier1_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tier1_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tier1_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (Tier 1)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### tier1_large_median
ggplot(pred_tier1_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tier1_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tier1_large_mean ###
geom_xribbon(data = pred_tier1_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tier1_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tier1_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tier1_large_1q ###
geom_xribbon(data = pred_tier1_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tier1_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tier1_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tier1_large_min ###
geom_xribbon(data = pred_tier1_large_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tier1_large_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tier1_large_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (Tier 1)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### tier2_small_median
ggplot(pred_tier2_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tier2_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tier2_small_mean ###
geom_xribbon(data = pred_tier2_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tier2_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tier2_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tier2_small_1q ###
geom_xribbon(data = pred_tier2_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tier2_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tier2_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tier2_small_min ###
geom_xribbon(data = pred_tier2_small_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tier2_small_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tier2_small_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (Tier 2)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### tier2_large_median
ggplot(pred_tier2_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tier2_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tier2_large_mean ###
geom_xribbon(data = pred_tier2_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tier2_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tier2_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tier2_large_1q ###
geom_xribbon(data = pred_tier2_large_1q , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tier2_large_1q , aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tier2_large_1q , aes(x = Conc, y =frac),
color = "green") +
### fourth line: tier2_large_min ###
geom_xribbon(data = pred_tier2_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tier2_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tier2_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (Tier 2)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### tier3.4_small_median
ggplot(pred_tier3.4_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tier3.4_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tier3.4_small_mean ###
geom_xribbon(data = pred_tier3.4_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tier3.4_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tier3.4_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tier3.4_small_1q ###
geom_xribbon(data = pred_tier3.4_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tier3.4_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tier3.4_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tier3.4_small_min ###
geom_xribbon(data = pred_tier3.4_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tier3.4_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tier3.4_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (Tier 3/4)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = min"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### tier3.4_large_median
ggplot(pred_tier3.4_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tier3.4_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tier3.4_large_mean ###
geom_xribbon(data = pred_tier3.4_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tier3.4_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tier3.4_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tier3.4_large_1q ###
geom_xribbon(data = pred_tier3.4_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tier3.4_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tier3.4_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tier3.4_large_min ###
geom_xribbon(data = pred_tier3.4_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tier3.4_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tier3.4_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (Tier 3/4)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
# Small/Large x tier 1/2/3 x median/mean/q1 = 2 x 3 x 3 = 18 comparisons
larges <- list(tier1_large_median_hc5, tier1_large_mean_hc5, tier1_large_1q_hc5, tier1_large_min_hc5,
tier1_large.obs[[1,1]], #n.obs
tier1_large.obs[[1,2]], #n.studies
tier1_large.obs[[1,3]], #n.taxa
tier1_large.obs[[1,4]], #n.species
#tier 2
tier2_large_median_hc5, tier2_large_mean_hc5, tier2_large_1q_hc5, tier2_large_min_hc5,
tier2_large.obs[[1,1]], #n.obs
tier2_large.obs[[1,2]], #n.studies
tier2_large.obs[[1,3]], #n.taxa
tier2_large.obs[[1,4]], #n.species
#tier 3 (hc5)
tier3.4_large_median_hc5, tier3.4_large_mean_hc5, tier3.4_large_1q_hc5, tier3.4_large_min_hc5,
tier3.4_large.obs[[1,1]], #n.obs
tier3.4_large.obs[[1,2]], #n.studies
tier3.4_large.obs[[1,3]], #n.taxa
tier3.4_large.obs[[1,4]], #n.species
#tier 4 (hc10)
tier3.4_large_median_hc10, tier3.4_large_mean_hc10, tier3.4_large_1q_hc10, tier3.4_large_min_hc10,
tier3.4_large.obs[[1,1]], #n.obs
tier3.4_large.obs[[1,2]], #n.studies
tier3.4_large.obs[[1,3]], #n.taxa
tier3.4_large.obs[[1,4]] #n.species
)
smalls <- list(tier1_small_median_hc5, tier1_small_mean_hc5, tier1_small_1q_hc5, tier1_small_min_hc5,
tier1_small.obs[[1,1]], #n.obs
tier1_small.obs[[1,2]], #n.studies
tier1_small.obs[[1,3]], #n.taxa
tier1_small.obs[[1,4]], #n.species
#tier 2
tier2_small_median_hc5, tier2_small_mean_hc5, tier2_small_1q_hc5, tier2_small_min_hc5,
tier2_small.obs[[1,1]], #n.obs
tier2_small.obs[[1,2]], #n.studies
tier2_small.obs[[1,3]], #n.taxa
tier2_small.obs[[1,4]], #n.species
#tier 3 (hc5)
tier3.4_small_median_hc5, tier3.4_small_mean_hc5, tier3.4_small_1q_hc5, tier3.4_small_min_hc5,
tier3.4_small.obs[[1,1]], #n.obs
tier3.4_small.obs[[1,2]], #n.studies
tier3.4_small.obs[[1,3]], #n.taxa
tier3.4_small.obs[[1,4]], #n.specie
#tier 4 (hc10)
tier3.4_small_median_hc10, tier3.4_small_mean_hc10, tier3.4_small_1q_hc10, tier3.4_small_min_hc10,
tier3.4_small.obs[[1,1]], #n.obs
tier3.4_small.obs[[1,2]], #n.studies
tier3.4_small.obs[[1,3]], #n.taxa
tier3.4_small.obs[[1,4]] #n.specie
)
## Conver to data frames
largesdf <- data.frame(t(matrix(unlist(larges), ncol = 4)))
smallsdf <- data.frame(t(matrix(unlist(smalls), ncol = 4))) #t = transpose
# convert mg/L to ug/L
largesdf <- largesdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
smallsdf <- smallsdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
# rename columns and rows
colnames(largesdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
colnames(smallsdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
rownames(largesdf) <- c("Tier 1", "Tier 2", "Tier 3", "Tier 4")
rownames(smallsdf) <- c("Tier 1", "Tier 2", "Tier 3", "Tier 4")
# provide tier column
largestibble <- tibble(largesdf,
Tier = rownames(largesdf))
#re-arrange columns
largestibble <- largestibble[c("Tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
# provide tier column
smallstibble <- tibble(smallsdf,
Tier = rownames(smallsdf))
#re-arrange columns
smallstibble <- smallstibble[c("Tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
#function to create tables
hp_table <- function(x){
#get full value range for whole table conditional formatting
full_val_range <- x %>%
ungroup %>%
select_if(is.numeric) %>%
range
#format colors accordingly
gt(x) %>%
fmt_number(columns = vars(Mean, Median, Quartile_1, Minimum),
n_sigfig = 2,
use_seps = TRUE) %>%
data_color(
columns = names(x)[2:5],
colors = scales::col_numeric(
palette = paletteer::paletteer_d(palette = "ggsci::teal_material") %>% as.character(),
domain = full_val_range),
alpha = 0.75) %>%
tab_options(column_labels.hidden = FALSE) %>%
as_raw_html() # return as html
}
#larges gt
larges_gt <- largestibble %>%
hp_table()
#smalls gt
smalls_gt <- smallstibble %>%
hp_table()
## Combine
data.tables <- data.frame(smalls_table = smalls_gt,
larges_table = larges_gt)
#Combine
allPass.summary <- data.tables %>%
gt() %>%
fmt_markdown(columns = TRUE) %>%
cols_label(smalls_table = "1-10 um",
larges_table = "10-5,000 um") %>%
tab_source_note(md("Calculated from SSDs")) %>%
tab_header(title = "Microplastics HC5 (ug/L) by Data Collapse and Tier",
subtitle = "Qualiter Filters: Risk and Tech Tier")
allPass.summary
| Microplastics HC5 (ug/L) by Data Collapse and Tier | |
|---|---|
| Qualiter Filters: Risk and Tech Tier | |
| 1-10 um | 10-5,000 um |
| Calculated from SSDs | |
risk.pass.tier1_large_median_ggplot <- ggplot(pred_risk.pass.tier1_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_risk.pass.tier1_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_risk.pass.tier1_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "risk.pass.tier1_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
risk.pass.tier1_large_median_ggplot
risk.pass.tier1_large_mean_ggplot <- ggplot(pred_risk.pass.tier1_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_risk.pass.tier1_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_risk.pass.tier1_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "risk.pass.tier1_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
risk.pass.tier1_large_mean_ggplot
risk.pass.tier2_large_median_ggplot <- ggplot(pred_risk.pass.tier2_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_risk.pass.tier2_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_risk.pass.tier2_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "risk.pass.tier2_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
risk.pass.tier2_large_median_ggplot
risk.pass.tier2_large_mean_ggplot <- ggplot(pred_risk.pass.tier2_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_risk.pass.tier2_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_risk.pass.tier2_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "risk.pass.tier2_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
risk.pass.tier2_large_mean_ggplot
risk.pass.tier3.4_large_median_ggplot <- ggplot(pred_risk.pass.tier3.4_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_risk.pass.tier3.4_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_risk.pass.tier3.4_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "risk.pass.tier3.4_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
risk.pass.tier3.4_large_median_ggplot
risk.pass.tier3.4_large_mean_ggplot <- ggplot(pred_risk.pass.tier3.4_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_risk.pass.tier3.4_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_risk.pass.tier3.4_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "risk.pass.tier3.4_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
risk.pass.tier3.4_large_mean_ggplot
### risk.pass.tier1_small_median
ggplot(pred_risk.pass.tier1_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_risk.pass.tier1_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: risk.pass.tier1_small_mean ###
geom_xribbon(data = pred_risk.pass.tier1_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_risk.pass.tier1_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_risk.pass.tier1_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: risk.pass.tier1_small_1q ###
geom_xribbon(data = pred_risk.pass.tier1_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_risk.pass.tier1_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_risk.pass.tier1_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: risk.pass.tier1_small_min ###
geom_xribbon(data = pred_risk.pass.tier1_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_risk.pass.tier1_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_risk.pass.tier1_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (risk.pass.tier 1)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### risk.pass.tier1_large_median
ggplot(pred_risk.pass.tier1_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_risk.pass.tier1_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: risk.pass.tier1_large_mean ###
geom_xribbon(data = pred_risk.pass.tier1_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_risk.pass.tier1_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_risk.pass.tier1_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: risk.pass.tier1_large_1q ###
geom_xribbon(data = pred_risk.pass.tier1_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_risk.pass.tier1_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_risk.pass.tier1_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: risk.pass.tier1_large_min ###
geom_xribbon(data = pred_risk.pass.tier1_large_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_risk.pass.tier1_large_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_risk.pass.tier1_large_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (risk.pass.tier 1)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### risk.pass.tier2_small_median
ggplot(pred_risk.pass.tier2_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_risk.pass.tier2_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: risk.pass.tier2_small_mean ###
geom_xribbon(data = pred_risk.pass.tier2_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_risk.pass.tier2_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_risk.pass.tier2_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: risk.pass.tier2_small_1q ###
geom_xribbon(data = pred_risk.pass.tier2_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_risk.pass.tier2_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_risk.pass.tier2_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: risk.pass.tier2_small_min ###
geom_xribbon(data = pred_risk.pass.tier2_small_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_risk.pass.tier2_small_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_risk.pass.tier2_small_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (risk.pass.tier 2)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### risk.pass.tier2_large_median
ggplot(pred_risk.pass.tier2_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_risk.pass.tier2_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: risk.pass.tier2_large_mean ###
geom_xribbon(data = pred_risk.pass.tier2_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_risk.pass.tier2_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_risk.pass.tier2_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: risk.pass.tier2_large_1q ###
geom_xribbon(data = pred_risk.pass.tier2_large_1q , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_risk.pass.tier2_large_1q , aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_risk.pass.tier2_large_1q , aes(x = Conc, y =frac),
color = "green") +
### fourth line: risk.pass.tier2_large_min ###
geom_xribbon(data = pred_risk.pass.tier2_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_risk.pass.tier2_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_risk.pass.tier2_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (risk.pass.tier 2)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### risk.pass.tier3.4_small_median
ggplot(pred_risk.pass.tier3.4_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_risk.pass.tier3.4_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: risk.pass.tier3.4_small_mean ###
geom_xribbon(data = pred_risk.pass.tier3.4_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_risk.pass.tier3.4_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_risk.pass.tier3.4_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: risk.pass.tier3.4_small_1q ###
geom_xribbon(data = pred_risk.pass.tier3.4_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_risk.pass.tier3.4_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_risk.pass.tier3.4_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: risk.pass.tier3.4_small_min ###
geom_xribbon(data = pred_risk.pass.tier3.4_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_risk.pass.tier3.4_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_risk.pass.tier3.4_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (risk.pass.tier 3/4)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = min"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### risk.pass.tier3.4_large_median
ggplot(pred_risk.pass.tier3.4_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_risk.pass.tier3.4_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: risk.pass.tier3.4_large_mean ###
geom_xribbon(data = pred_risk.pass.tier3.4_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_risk.pass.tier3.4_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_risk.pass.tier3.4_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: risk.pass.tier3.4_large_1q ###
geom_xribbon(data = pred_risk.pass.tier3.4_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_risk.pass.tier3.4_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_risk.pass.tier3.4_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: risk.pass.tier3.4_large_min ###
geom_xribbon(data = pred_risk.pass.tier3.4_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_risk.pass.tier3.4_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_risk.pass.tier3.4_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (risk.pass.tier 3/4)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
# Small/Large x risk.pass.tier 1/2/3 x median/mean/q1 = 2 x 3 x 3 = 18 comparisons
larges <- list(risk.pass.tier1_large_median_hc5, risk.pass.tier1_large_mean_hc5, risk.pass.tier1_large_1q_hc5, risk.pass.tier1_large_min_hc5,
risk.pass.tier1_large.obs[[1,1]], #n.obs
risk.pass.tier1_large.obs[[1,2]], #n.studies
risk.pass.tier1_large.obs[[1,3]], #n.taxa
risk.pass.tier1_large.obs[[1,4]], #n.species
#risk.pass.tier 2
risk.pass.tier2_large_median_hc5, risk.pass.tier2_large_mean_hc5, risk.pass.tier2_large_1q_hc5, risk.pass.tier2_large_min_hc5,
risk.pass.tier2_large.obs[[1,1]], #n.obs
risk.pass.tier2_large.obs[[1,2]], #n.studies
risk.pass.tier2_large.obs[[1,3]], #n.taxa
risk.pass.tier2_large.obs[[1,4]], #n.species
#risk.pass.tier 3 (hc5)
risk.pass.tier3.4_large_median_hc5, risk.pass.tier3.4_large_mean_hc5, risk.pass.tier3.4_large_1q_hc5, risk.pass.tier3.4_large_min_hc5,
risk.pass.tier3.4_large.obs[[1,1]], #n.obs
risk.pass.tier3.4_large.obs[[1,2]], #n.studies
risk.pass.tier3.4_large.obs[[1,3]], #n.taxa
risk.pass.tier3.4_large.obs[[1,4]], #n.species
#risk.pass.tier 4 (hc10)
risk.pass.tier3.4_large_median_hc10, risk.pass.tier3.4_large_mean_hc10, risk.pass.tier3.4_large_1q_hc10, risk.pass.tier3.4_large_min_hc10,
risk.pass.tier3.4_large.obs[[1,1]], #n.obs
risk.pass.tier3.4_large.obs[[1,2]], #n.studies
risk.pass.tier3.4_large.obs[[1,3]], #n.taxa
risk.pass.tier3.4_large.obs[[1,4]] #n.species
)
smalls <- list(risk.pass.tier1_small_median_hc5, risk.pass.tier1_small_mean_hc5, risk.pass.tier1_small_1q_hc5, risk.pass.tier1_small_min_hc5,
risk.pass.tier1_small.obs[[1,1]], #n.obs
risk.pass.tier1_small.obs[[1,2]], #n.studies
risk.pass.tier1_small.obs[[1,3]], #n.taxa
risk.pass.tier1_small.obs[[1,4]], #n.species
#risk.pass.tier 2
risk.pass.tier2_small_median_hc5, risk.pass.tier2_small_mean_hc5, risk.pass.tier2_small_1q_hc5, risk.pass.tier2_small_min_hc5,
risk.pass.tier2_small.obs[[1,1]], #n.obs
risk.pass.tier2_small.obs[[1,2]], #n.studies
risk.pass.tier2_small.obs[[1,3]], #n.taxa
risk.pass.tier2_small.obs[[1,4]], #n.species
#risk.pass.tier 3 (hc5)
risk.pass.tier3.4_small_median_hc5, risk.pass.tier3.4_small_mean_hc5, risk.pass.tier3.4_small_1q_hc5, risk.pass.tier3.4_small_min_hc5,
risk.pass.tier3.4_small.obs[[1,1]], #n.obs
risk.pass.tier3.4_small.obs[[1,2]], #n.studies
risk.pass.tier3.4_small.obs[[1,3]], #n.taxa
risk.pass.tier3.4_small.obs[[1,4]], #n.species
#risk.pass.tier 4 (hc10)
risk.pass.tier3.4_small_median_hc10, risk.pass.tier3.4_small_mean_hc10, risk.pass.tier3.4_small_1q_hc10, risk.pass.tier3.4_small_min_hc10,
risk.pass.tier3.4_small.obs[[1,1]], #n.obs
risk.pass.tier3.4_small.obs[[1,2]], #n.studies
risk.pass.tier3.4_small.obs[[1,3]], #n.taxa
risk.pass.tier3.4_small.obs[[1,4]] #n.species
)
## Conver to data frames
largesdf <- data.frame(t(matrix(unlist(larges), ncol = 4)))
smallsdf <- data.frame(t(matrix(unlist(smalls), ncol = 4))) #t = transpose
# convert mg/L to ug/L
largesdf <- largesdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
smallsdf <- smallsdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
# rename columns and rows
colnames(largesdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
colnames(smallsdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
rownames(largesdf) <- c("tier 1", "tier 2", "tier 3", "tier 4")
rownames(smallsdf) <- c("tier 1", "tier 2", "tier 3", "tier 4")
# provide risk.pass.tier column
largestibble <- tibble(largesdf,
tier = rownames(largesdf))
#re-arrange columns
largestibble <- largestibble[c("tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
# provide risk.pass.tier column
smallstibble <- tibble(smallsdf,
tier = rownames(smallsdf))
#re-arrange columns
smallstibble <- smallstibble[c("tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
#function to create tables
hp_table <- function(x){
#get full value range for whole table conditional formatting
full_val_range <- x %>%
ungroup %>%
select_if(is.numeric) %>%
range
#format colors accordingly
gt(x) %>%
fmt_number(columns = vars(Mean, Median, Quartile_1, Minimum),
n_sigfig = 2,
use_seps = TRUE) %>%
data_color(
columns = names(x)[2:5],
colors = scales::col_numeric(
palette = paletteer::paletteer_d(palette = "ggsci::teal_material") %>% as.character(),
domain = full_val_range),
alpha = 0.75) %>%
tab_options(column_labels.hidden = FALSE) %>%
as_raw_html() # return as html
}
#larges gt
larges_gt <- largestibble %>%
hp_table()
#smalls gt
smalls_gt <- smallstibble %>%
hp_table()
## Combine
data.tables <- data.frame(smalls_table = smalls_gt,
larges_table = larges_gt)
#Combine
risk.pass.summary <- data.tables %>%
gt() %>%
fmt_markdown(columns = TRUE) %>%
cols_label(smalls_table = "1-10 um",
larges_table = "10-5,000 um") %>%
tab_source_note(md("Calculated from SSDs")) %>%
tab_header(title = "Microplastics HC5 (ug/L) by Data Collapse and risk.pass.tier",
subtitle = "Qualiter Filters: Risk (pass), tech (pass & fail)")
#print
risk.pass.summary
| Microplastics HC5 (ug/L) by Data Collapse and risk.pass.tier | |
|---|---|
| Qualiter Filters: Risk (pass), tech (pass & fail) | |
| 1-10 um | 10-5,000 um |
| Calculated from SSDs | |
tech.pass.tier1_large_median_ggplot <- ggplot(pred_tech.pass.tier1_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tech.pass.tier1_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tech.pass.tier1_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tech.pass.tier1_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tech.pass.tier1_large_median_ggplot
tech.pass.tier1_large_mean_ggplot <- ggplot(pred_tech.pass.tier1_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tech.pass.tier1_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tech.pass.tier1_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tech.pass.tier1_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tech.pass.tier1_large_mean_ggplot
tech.pass.tier2_large_median_ggplot <- ggplot(pred_tech.pass.tier2_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tech.pass.tier2_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tech.pass.tier2_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tech.pass.tier2_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tech.pass.tier2_large_median_ggplot
tech.pass.tier2_large_mean_ggplot <- ggplot(pred_tech.pass.tier2_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tech.pass.tier2_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tech.pass.tier2_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tech.pass.tier2_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tech.pass.tier2_large_mean_ggplot
tech.pass.tier3.4_large_median_ggplot <- ggplot(pred_tech.pass.tier3.4_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tech.pass.tier3.4_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tech.pass.tier3.4_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tech.pass.tier3.4_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tech.pass.tier3.4_large_median_ggplot
tech.pass.tier3.4_large_mean_ggplot <- ggplot(pred_tech.pass.tier3.4_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_tech.pass.tier3.4_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_tech.pass.tier3.4_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "tech.pass.tier3.4_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
tech.pass.tier3.4_large_mean_ggplot
### tech.pass.tier1_small_median
ggplot(pred_tech.pass.tier1_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tech.pass.tier1_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tech.pass.tier1_small_mean ###
geom_xribbon(data = pred_tech.pass.tier1_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tech.pass.tier1_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tech.pass.tier1_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tech.pass.tier1_small_1q ###
geom_xribbon(data = pred_tech.pass.tier1_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tech.pass.tier1_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tech.pass.tier1_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tech.pass.tier1_small_min ###
geom_xribbon(data = pred_tech.pass.tier1_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tech.pass.tier1_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tech.pass.tier1_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (tech.pass.tier 1)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### tech.pass.tier1_large_median
ggplot(pred_tech.pass.tier1_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tech.pass.tier1_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tech.pass.tier1_large_mean ###
geom_xribbon(data = pred_tech.pass.tier1_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tech.pass.tier1_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tech.pass.tier1_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tech.pass.tier1_large_1q ###
geom_xribbon(data = pred_tech.pass.tier1_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tech.pass.tier1_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tech.pass.tier1_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tech.pass.tier1_large_min ###
geom_xribbon(data = pred_tech.pass.tier1_large_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tech.pass.tier1_large_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tech.pass.tier1_large_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (tech.pass.tier 1)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### tech.pass.tier2_small_median
ggplot(pred_tech.pass.tier2_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tech.pass.tier2_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tech.pass.tier2_small_mean ###
geom_xribbon(data = pred_tech.pass.tier2_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tech.pass.tier2_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tech.pass.tier2_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tech.pass.tier2_small_1q ###
geom_xribbon(data = pred_tech.pass.tier2_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tech.pass.tier2_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tech.pass.tier2_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tech.pass.tier2_small_min ###
geom_xribbon(data = pred_tech.pass.tier2_small_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tech.pass.tier2_small_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tech.pass.tier2_small_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (tech.pass.tier 2)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### tech.pass.tier2_large_median
ggplot(pred_tech.pass.tier2_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tech.pass.tier2_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tech.pass.tier2_large_mean ###
geom_xribbon(data = pred_tech.pass.tier2_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tech.pass.tier2_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tech.pass.tier2_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tech.pass.tier2_large_1q ###
geom_xribbon(data = pred_tech.pass.tier2_large_1q , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tech.pass.tier2_large_1q , aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tech.pass.tier2_large_1q , aes(x = Conc, y =frac),
color = "green") +
### fourth line: tech.pass.tier2_large_min ###
geom_xribbon(data = pred_tech.pass.tier2_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tech.pass.tier2_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tech.pass.tier2_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (tech.pass.tier 2)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### tech.pass.tier3.4_small_median
ggplot(pred_tech.pass.tier3.4_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tech.pass.tier3.4_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tech.pass.tier3.4_small_mean ###
geom_xribbon(data = pred_tech.pass.tier3.4_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tech.pass.tier3.4_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tech.pass.tier3.4_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tech.pass.tier3.4_small_1q ###
geom_xribbon(data = pred_tech.pass.tier3.4_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tech.pass.tier3.4_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tech.pass.tier3.4_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tech.pass.tier3.4_small_min ###
geom_xribbon(data = pred_tech.pass.tier3.4_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tech.pass.tier3.4_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tech.pass.tier3.4_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (tech.pass.tier 3/4)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = min"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### tech.pass.tier3.4_large_median
ggplot(pred_tech.pass.tier3.4_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_tech.pass.tier3.4_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: tech.pass.tier3.4_large_mean ###
geom_xribbon(data = pred_tech.pass.tier3.4_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_tech.pass.tier3.4_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_tech.pass.tier3.4_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: tech.pass.tier3.4_large_1q ###
geom_xribbon(data = pred_tech.pass.tier3.4_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_tech.pass.tier3.4_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_tech.pass.tier3.4_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: tech.pass.tier3.4_large_min ###
geom_xribbon(data = pred_tech.pass.tier3.4_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_tech.pass.tier3.4_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_tech.pass.tier3.4_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (tech.pass.tier 3/4)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
## Summary Table
# Small/Large x tech.pass.tier 1/2/3 x median/mean/q1 = 2 x 3 x 3 = 18 comparisons
larges <- list(tech.pass.tier1_large_median_hc5, tech.pass.tier1_large_mean_hc5, tech.pass.tier1_large_1q_hc5, tech.pass.tier1_large_min_hc5,
tech.pass.tier1_large.obs[[1,1]], #n.obs
tech.pass.tier1_large.obs[[1,2]], #n.studies
tech.pass.tier1_large.obs[[1,3]], #n.taxa
tech.pass.tier1_large.obs[[1,4]], #n.species
#tech.pass.tier 2
tech.pass.tier2_large_median_hc5, tech.pass.tier2_large_mean_hc5, tech.pass.tier2_large_1q_hc5, tech.pass.tier2_large_min_hc5,
tech.pass.tier2_large.obs[[1,1]], #n.obs
tech.pass.tier2_large.obs[[1,2]], #n.studies
tech.pass.tier2_large.obs[[1,3]], #n.taxa
tech.pass.tier2_large.obs[[1,4]], #n.species
#tech.pass.tier 3 (hc5)
tech.pass.tier3.4_large_median_hc5, tech.pass.tier3.4_large_mean_hc5, tech.pass.tier3.4_large_1q_hc5, tech.pass.tier3.4_large_min_hc5,
tech.pass.tier3.4_large.obs[[1,1]], #n.obs
tech.pass.tier3.4_large.obs[[1,2]], #n.studies
tech.pass.tier3.4_large.obs[[1,3]], #n.taxa
tech.pass.tier3.4_large.obs[[1,4]], #n.species
#tech.pass.tier 4 (hc10)
tech.pass.tier3.4_large_median_hc10, tech.pass.tier3.4_large_mean_hc10, tech.pass.tier3.4_large_1q_hc10, tech.pass.tier3.4_large_min_hc10,
tech.pass.tier3.4_large.obs[[1,1]], #n.obs
tech.pass.tier3.4_large.obs[[1,2]], #n.studies
tech.pass.tier3.4_large.obs[[1,3]], #n.taxa
tech.pass.tier3.4_large.obs[[1,4]] #n.species
)
smalls <- list(tech.pass.tier1_small_median_hc5, tech.pass.tier1_small_mean_hc5, tech.pass.tier1_small_1q_hc5, tech.pass.tier1_small_min_hc5,
tech.pass.tier1_small.obs[[1,1]], #n.obs
tech.pass.tier1_small.obs[[1,2]], #n.studies
tech.pass.tier1_small.obs[[1,3]], #n.taxa
tech.pass.tier1_small.obs[[1,4]], #n.species
#tech.pass.tier 2
tech.pass.tier2_small_median_hc5, tech.pass.tier2_small_mean_hc5, tech.pass.tier2_small_1q_hc5, tech.pass.tier2_small_min_hc5,
tech.pass.tier2_small.obs[[1,1]], #n.obs
tech.pass.tier2_small.obs[[1,2]], #n.studies
tech.pass.tier2_small.obs[[1,3]], #n.taxa
tech.pass.tier2_small.obs[[1,4]], #n.species
#tech.pass.tier 3 (hc5)
tech.pass.tier3.4_small_median_hc5, tech.pass.tier3.4_small_mean_hc5, tech.pass.tier3.4_small_1q_hc5, tech.pass.tier3.4_small_min_hc5,
tech.pass.tier3.4_small.obs[[1,1]], #n.obs
tech.pass.tier3.4_small.obs[[1,2]], #n.studies
tech.pass.tier3.4_small.obs[[1,3]], #n.taxa
tech.pass.tier3.4_small.obs[[1,4]], #n.species
#tech.pass.tier 4 (hc10)
tech.pass.tier3.4_small_median_hc10, tech.pass.tier3.4_small_mean_hc10, tech.pass.tier3.4_small_1q_hc10, tech.pass.tier3.4_small_min_hc10,
tech.pass.tier3.4_small.obs[[1,1]], #n.obs
tech.pass.tier3.4_small.obs[[1,2]], #n.studies
tech.pass.tier3.4_small.obs[[1,3]], #n.taxa
tech.pass.tier3.4_small.obs[[1,4]] #n.species
)
## Conver to data frames
largesdf <- data.frame(t(matrix(unlist(larges), ncol = 4)))
smallsdf <- data.frame(t(matrix(unlist(smalls), ncol = 4))) #t = transpose
# convert mg/L to ug/L
largesdf <- largesdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
smallsdf <- smallsdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
# rename columns and rows
colnames(largesdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
colnames(smallsdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
rownames(largesdf) <- c("Tier 1", "Tier 2", "Tier 3", "Tier 4")
rownames(smallsdf) <- c("Tier 1", "Tier 2", "Tier 3", "Tier 4")
# provide tier column
largestibble <- tibble(largesdf,
Tier = rownames(largesdf))
#re-arrange columns
largestibble <- largestibble[c("Tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
# provide tier column
smallstibble <- tibble(smallsdf,
Tier = rownames(smallsdf))
#re-arrange columns
smallstibble <- smallstibble[c("Tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
#function to create tables
hp_table <- function(x){
#get full value range for whole table conditional formatting
full_val_range <- x %>%
ungroup %>%
select_if(is.numeric) %>%
range
#format colors accordingly
gt(x) %>%
fmt_number(columns = vars(Mean, Median, Quartile_1, Minimum),
n_sigfig = 2,
use_seps = TRUE) %>%
data_color(
columns = names(x)[2:5],
colors = scales::col_numeric(
palette = paletteer::paletteer_d(palette = "ggsci::teal_material") %>% as.character(),
domain = full_val_range),
alpha = 0.75) %>%
tab_options(column_labels.hidden = FALSE) %>%
as_raw_html() # return as html
}
#larges gt
larges_gt <- largestibble %>%
hp_table()
#smalls gt
smalls_gt <- smallstibble %>%
hp_table()
## Combine
data.tables <- data.frame(smalls_table = smalls_gt,
larges_table = larges_gt)
#Combine
tech.pass.summary <- data.tables %>%
gt() %>%
fmt_markdown(columns = TRUE) %>%
cols_label(smalls_table = "1-10 um",
larges_table = "10-5,000 um") %>%
tab_source_note(md("Calculated from SSDs")) %>%
tab_header(title = "Microplastics HC5 (ug/L) by Data Collapse and Tier",
subtitle = "Qualiter Filters: Risk (pass & fail) Tech (pass)")
#print
tech.pass.summary
| Microplastics HC5 (ug/L) by Data Collapse and Tier | |
|---|---|
| Qualiter Filters: Risk (pass & fail) Tech (pass) | |
| 1-10 um | 10-5,000 um |
| Calculated from SSDs | |
allFail.tier1_large_median_ggplot <- ggplot(pred_allFail.tier1_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_allFail.tier1_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_allFail.tier1_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "allFail.tier1_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
allFail.tier1_large_median_ggplot
allFail.tier1_large_mean_ggplot <- ggplot(pred_allFail.tier1_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_allFail.tier1_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_allFail.tier1_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "allFail.tier1_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
allFail.tier1_large_mean_ggplot
allFail.tier2_large_median_ggplot <- ggplot(pred_allFail.tier2_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_allFail.tier2_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_allFail.tier2_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "allFail.tier2_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
allFail.tier2_large_median_ggplot
allFail.tier2_large_mean_ggplot <- ggplot(pred_allFail.tier2_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_allFail.tier2_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_allFail.tier2_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "allFail.tier2_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
allFail.tier2_large_mean_ggplot
allFail.tier3.4_large_median_ggplot <- ggplot(pred_allFail.tier3.4_large_median,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_allFail.tier3.4_large_median,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_allFail.tier3.4_large_median, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "allFail.tier3.4_large_median") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
allFail.tier3.4_large_median_ggplot
allFail.tier3.4_large_mean_ggplot <- ggplot(pred_allFail.tier3.4_large_mean,aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2, color = "blue", fill = "lightblue") +
geom_line(aes_string(y = "percent/100"), color = "gray") +
geom_point(data = SSD_allFail.tier3.4_large_mean,aes(x = Conc, y =frac, color = Group)) +
geom_text_repel(data = SSD_allFail.tier3.4_large_mean, aes(x = Conc, y = frac, label = Species, color = Group), nudge_x = 0.2, size = 3, segment.alpha = 0.5) +
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "allFail.tier3.4_large_mean") +
fill.type + #user-selected
color.type + #user-selected
theme.type #user theme
allFail.tier3.4_large_mean_ggplot
### allFail.tier1_small_median
ggplot(pred_allFail.tier1_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_allFail.tier1_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: allFail.tier1_small_mean ###
geom_xribbon(data = pred_allFail.tier1_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_allFail.tier1_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_allFail.tier1_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: allFail.tier1_small_1q ###
geom_xribbon(data = pred_allFail.tier1_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_allFail.tier1_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_allFail.tier1_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: allFail.tier1_small_min ###
geom_xribbon(data = pred_allFail.tier1_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_allFail.tier1_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_allFail.tier1_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (allFail.tier 1)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### allFail.tier1_large_median
ggplot(pred_allFail.tier1_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_allFail.tier1_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: allFail.tier1_large_mean ###
geom_xribbon(data = pred_allFail.tier1_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_allFail.tier1_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_allFail.tier1_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: allFail.tier1_large_1q ###
geom_xribbon(data = pred_allFail.tier1_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_allFail.tier1_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_allFail.tier1_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: allFail.tier1_large_min ###
geom_xribbon(data = pred_allFail.tier1_large_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_allFail.tier1_large_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_allFail.tier1_large_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (allFail.tier 1)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### allFail.tier2_small_median
ggplot(pred_allFail.tier2_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_allFail.tier2_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: allFail.tier2_small_mean ###
geom_xribbon(data = pred_allFail.tier2_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_allFail.tier2_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_allFail.tier2_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: allFail.tier2_small_1q ###
geom_xribbon(data = pred_allFail.tier2_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_allFail.tier2_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_allFail.tier2_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: allFail.tier2_small_min ###
geom_xribbon(data = pred_allFail.tier2_small_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_allFail.tier2_small_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_allFail.tier2_small_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (allFail.tier 2)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### allFail.tier2_large_median
ggplot(pred_allFail.tier2_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_allFail.tier2_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: allFail.tier2_large_mean ###
geom_xribbon(data = pred_allFail.tier2_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_allFail.tier2_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_allFail.tier2_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: allFail.tier2_large_1q ###
geom_xribbon(data = pred_allFail.tier2_large_1q , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_allFail.tier2_large_1q , aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_allFail.tier2_large_1q , aes(x = Conc, y =frac),
color = "green") +
### fourth line: allFail.tier2_large_min ###
geom_xribbon(data = pred_allFail.tier2_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_allFail.tier2_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_allFail.tier2_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (allFail.tier 2)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### allFail.tier3.4_small_median
ggplot(pred_allFail.tier3.4_small_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_allFail.tier3.4_small_median,aes(x = Conc, y =frac),
color = "red") +
### second line: allFail.tier3.4_small_mean ###
geom_xribbon(data = pred_allFail.tier3.4_small_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_allFail.tier3.4_small_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_allFail.tier3.4_small_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: allFail.tier3.4_small_1q ###
geom_xribbon(data = pred_allFail.tier3.4_small_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_allFail.tier3.4_small_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_allFail.tier3.4_small_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: allFail.tier3.4_small_min ###
geom_xribbon(data = pred_allFail.tier3.4_small_min, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_allFail.tier3.4_small_min, aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_allFail.tier3.4_small_min, aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (allFail.tier 3/4)",
subtitle = ("Size Range: 1 - 10 um; Red = median, blue = mean, green = first quartile, grey = min"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
### Large (10 - 5000 um)s
### allFail.tier3.4_large_median
ggplot(pred_allFail.tier3.4_large_median, aes_string(x = "est")) +
geom_xribbon(aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "red", fill = "red") +
geom_line(aes_string(y = "percent/100"),
color = "red") +
geom_point(data = SSD_allFail.tier3.4_large_median,aes(x = Conc, y =frac),
color = "red") +
### second line: allFail.tier3.4_large_mean ###
geom_xribbon(data = pred_allFail.tier3.4_large_mean, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "blue", fill = "blue") +
geom_line(data = pred_allFail.tier3.4_large_mean, aes_string(y = "percent/100"),
color = "blue") +
geom_point(data = SSD_allFail.tier3.4_large_mean, aes(x = Conc, y =frac),
color = "blue") +
### third line: allFail.tier3.4_large_1q ###
geom_xribbon(data = pred_allFail.tier3.4_large_1q, aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "green", fill = "green") +
geom_line(data = pred_allFail.tier3.4_large_1q, aes_string(y = "percent/100"),
color = "green") +
geom_point(data = SSD_allFail.tier3.4_large_1q, aes(x = Conc, y =frac),
color = "green") +
### fourth line: allFail.tier3.4_large_min ###
geom_xribbon(data = pred_allFail.tier3.4_large_min , aes_string(xmin = "lcl", xmax = "ucl", y = "percent/100"), alpha = 0.2,
color = "grey10", fill = "grey10") +
geom_line(data = pred_allFail.tier3.4_large_min , aes_string(y = "percent/100"),
color = "grey10") +
geom_point(data = SSD_allFail.tier3.4_large_min , aes(x = Conc, y =frac),
color = "grey10") +
### plot parameters ###
scale_y_continuous("Species Affected (%)", labels = scales::percent, limits = c(0,1)) +
xlab(particle_mass_check_ssd)+
coord_trans(x = "log10") +
scale_x_continuous(breaks = scales::trans_breaks("log10", function(x) 10^x, n = 15),
labels = trans_format("log10", scales::math_format(10^.x))) +
labs(title = "Species Sensitivity Distributions by Data Collapsing (allFail.tier 3/4)",
subtitle = ("Size Range: 10 - 5,000 um; Red = median, blue = mean, green = first quartile, grey = minimum"),
caption = ("All endpoints")) +
theme.type +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5, size = 20),
axis.title = element_text(size = 16),
axis.text = element_text(size = 16),
legend.text = element_text(size =14),
legend.title = element_blank(),
plot.subtitle = element_text(hjust = 0.5, size = 14))
## Summary Table
# Small/Large x allFail.tier 1/2/3 x median/mean/q1 = 2 x 3 x 3 = 18 comparisons
larges <- list(allFail.tier1_large_median_hc5, allFail.tier1_large_mean_hc5, allFail.tier1_large_1q_hc5, allFail.tier1_large_min_hc5,
allFail.tier1_large.obs[[1,1]], #n.obs
allFail.tier1_large.obs[[1,2]], #n.studies
allFail.tier1_large.obs[[1,3]], #n.taxa
allFail.tier1_large.obs[[1,4]], #n.species
#allFail.tier 2
allFail.tier2_large_median_hc5, allFail.tier2_large_mean_hc5, allFail.tier2_large_1q_hc5, allFail.tier2_large_min_hc5,
allFail.tier2_large.obs[[1,1]], #n.obs
allFail.tier2_large.obs[[1,2]], #n.studies
allFail.tier2_large.obs[[1,3]], #n.taxa
allFail.tier2_large.obs[[1,4]], #n.species
#allFail.tier 3 (hc5)
allFail.tier3.4_large_median_hc5, allFail.tier3.4_large_mean_hc5, allFail.tier3.4_large_1q_hc5, allFail.tier3.4_large_min_hc5,
allFail.tier3.4_large.obs[[1,1]], #n.obs
allFail.tier3.4_large.obs[[1,2]], #n.studies
allFail.tier3.4_large.obs[[1,3]], #n.taxa
allFail.tier3.4_large.obs[[1,4]], #n.species
#allFail.tier 4 (hc10)
allFail.tier3.4_large_median_hc10, allFail.tier3.4_large_mean_hc10, allFail.tier3.4_large_1q_hc10, allFail.tier3.4_large_min_hc10,
allFail.tier3.4_large.obs[[1,1]], #n.obs
allFail.tier3.4_large.obs[[1,2]], #n.studies
allFail.tier3.4_large.obs[[1,3]], #n.taxa
allFail.tier3.4_large.obs[[1,4]] #n.species
)
smalls <- list(allFail.tier1_small_median_hc5, allFail.tier1_small_mean_hc5, allFail.tier1_small_1q_hc5, allFail.tier1_small_min_hc5,
allFail.tier1_small.obs[[1,1]], #n.obs
allFail.tier1_small.obs[[1,2]], #n.studies
allFail.tier1_small.obs[[1,3]], #n.taxa
allFail.tier1_small.obs[[1,4]], #n.species
#allFail.tier 2
allFail.tier2_small_median_hc5, allFail.tier2_small_mean_hc5, allFail.tier2_small_1q_hc5, allFail.tier2_small_min_hc5,
allFail.tier2_small.obs[[1,1]], #n.obs
allFail.tier2_small.obs[[1,2]], #n.studies
allFail.tier2_small.obs[[1,3]], #n.taxa
allFail.tier2_small.obs[[1,4]], #n.species
#allFail.tier 3 (hc5)
allFail.tier3.4_small_median_hc5, allFail.tier3.4_small_mean_hc5, allFail.tier3.4_small_1q_hc5, allFail.tier3.4_small_min_hc5,
allFail.tier3.4_small.obs[[1,1]], #n.obs
allFail.tier3.4_small.obs[[1,2]], #n.studies
allFail.tier3.4_small.obs[[1,3]], #n.taxa
allFail.tier3.4_small.obs[[1,4]], #n.species
#allFail.tier 4 (hc10)
allFail.tier3.4_small_median_hc10, allFail.tier3.4_small_mean_hc10, allFail.tier3.4_small_1q_hc10, allFail.tier3.4_small_min_hc10,
allFail.tier3.4_small.obs[[1,1]], #n.obs
allFail.tier3.4_small.obs[[1,2]], #n.studies
allFail.tier3.4_small.obs[[1,3]], #n.taxa
allFail.tier3.4_small.obs[[1,4]] #n.species
)
## Conver to data frames
largesdf <- data.frame(t(matrix(unlist(larges), ncol = 4)))
smallsdf <- data.frame(t(matrix(unlist(smalls), ncol = 4))) #t = transpose
# convert mg/L to ug/L
largesdf <- largesdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
smallsdf <- smallsdf %>%
mutate_at(c(1:4), as.numeric) %>%
mutate_at(c(1:4), funs(. * 1000)) %>% #don't convert n.obs and n.doi
mutate_at(c(5:6), as.character) #make sure DOI and n are characters so they don't get color coded below
# rename columns and rows
colnames(largesdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
colnames(smallsdf) <- c("Median", "Mean", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")
rownames(largesdf) <- c("Tier 1", "Tier 2", "Tier 3", "Tier 4")
rownames(smallsdf) <- c("Tier 1", "Tier 2", "Tier 3", "Tier 4")
# provide tier column
largestibble <- tibble(largesdf,
Tier = rownames(largesdf))
#re-arrange columns
largestibble <- largestibble[c("Tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
# provide tier column
smallstibble <- tibble(smallsdf,
Tier = rownames(smallsdf))
#re-arrange columns
smallstibble <- smallstibble[c("Tier", "Mean", "Median", "Quartile_1", "Minimum", "N_Obs.", "N_Doi", "N_Taxa", "N_Species")]
#function to create tables
hp_table <- function(x){
#get full value range for whole table conditional formatting
full_val_range <- x %>%
ungroup %>%
select_if(is.numeric) %>%
range
#format colors accordingly
gt(x) %>%
fmt_number(columns = vars(Mean, Median, Quartile_1, Minimum),
n_sigfig = 2,
use_seps = TRUE) %>%
data_color(
columns = names(x)[2:5],
colors = scales::col_numeric(
palette = paletteer::paletteer_d(palette = "ggsci::teal_material") %>% as.character(),
domain = full_val_range),
alpha = 0.75) %>%
tab_options(column_labels.hidden = FALSE) %>%
as_raw_html() # return as html
}
#larges gt
larges_gt <- largestibble %>%
hp_table()
#smalls gt
smalls_gt <- smallstibble %>%
hp_table()
## Combine
data.tables <- data.frame(smalls_table = smalls_gt,
larges_table = larges_gt)
#Combine
allFail.summary <- data.tables %>%
gt() %>%
fmt_markdown(columns = TRUE) %>%
cols_label(smalls_table = "1-10 um",
larges_table = "10-5,000 um") %>%
tab_source_note(md("Calculated from SSDs")) %>%
tab_header(title = "Microplastics HC5 (ug/L) by Data Collapse and Tier",
subtitle = "Qualiter Filters: Risk (pass & fail); Tech (pass & fail)")
#print
allFail.summary
| Microplastics HC5 (ug/L) by Data Collapse and Tier | |
|---|---|
| Qualiter Filters: Risk (pass & fail); Tech (pass & fail) | |
| 1-10 um | 10-5,000 um |
| Calculated from SSDs | |
## Combine data tables from all quality tiers
data.tables <- data.frame(allPass = allPass.summary,
risk.pass = risk.pass.summary,
tech.pass = tech.pass.summary,
allFail = allFail.summary)
#Combine
data.tables %>%
gt() %>%
fmt_markdown(columns = TRUE) #%>%
| allPass.smalls_table | allPass.larges_table | risk.pass.smalls_table | risk.pass.larges_table | tech.pass.smalls_table | tech.pass.larges_table | allFail.smalls_table | allFail.larges_table |
|---|---|---|---|---|---|---|---|
#cols_label(allPass = "Risk and Tech Tier Pass",
# risk.pass = "Risk Pass; Tech Pass & Fail",
# tech.pass = "Risk Pass & Fail; Tech Fail",
# allFail = "Risk Pass & Fail; Tech Pass & Fail")